package pers.linkong.asr.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import pers.linkong.asr.domain.SchedulerBean;
import pers.linkong.asr.mapper.SchedulerMapper;

@Service
// Service组件
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.SERIALIZABLE, readOnly = false)
public class SchedulerService {
	@Autowired
	private SchedulerMapper schedulerMapper;

	// 改
	public void updateScheduler(SchedulerBean scheduler) throws Exception {
		this.schedulerMapper.updateScheduler(scheduler);
	}
	
	// 查
	public SchedulerBean getSchedulerByLesson(int lesson) {
		return this.schedulerMapper.getSchedulerByLesson(lesson);
	}

	// 查
	public List<SchedulerBean> getScheduler() throws Exception {
		List<SchedulerBean> schedulerBeans = this.schedulerMapper.getScheduler();
		return schedulerBeans;
	}

}
